<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            width: 300px;
            height: 300px;
        }
        .box1{
            background-color: pink;
            position: absolute;
            /*改变层级之间的关系*/
            z-index: 10;
        }
        .box2{
            background-color: orange;
            /*使用定位来完成盒子的层叠情况*/
            position: relative;
            left: 150px;
            top: -150px;
        }
    </style>
</head>
<body>
<!--浮动完成盒子的层叠情况-->
<div class="box1"></div>
<div class="box2"></div>
我
</body>
</html>